home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dhcp3-client.postinst < prev    next >
Text File  |  2009-10-08  |  2KB  |  66 lines

  1. #!/bin/sh -e
  2. #
  3. # $Id: dhcp3-client.postinst,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
  4. #
  5.  
  6. # Source debconf library.
  7. . /usr/share/debconf/confmodule
  8.  
  9. # Remove a no-longer used conffile
  10. rm_conffile()
  11. {
  12.     CONFFILE="$1"
  13.  
  14.     if [ -e "$CONFFILE".dpkg-obsolete ]; then
  15.         echo "Removing obsolete conffile $CONFFILE"
  16.         rm -f "$CONFFILE".dpkg-obsolete
  17.     fi
  18. }
  19.  
  20. case "$1" in
  21.     configure)
  22.         if [ ! -e /var/lib/dhcp3/dhclient.leases ]; then
  23.             if test -e /var/lib/dhcp/dhclient.leases; then
  24.                 cp /var/lib/dhcp/dhclient.leases /var/lib/dhcp3/dhclient.leases
  25.             else
  26.                 touch /var/lib/dhcp3/dhclient.leases
  27.             fi
  28.         fi
  29.  
  30.     if dpkg --compare-versions "$2" lt-nl "3.0.4-2"; then
  31.         if [ -e /etc/dhcp3/dhclient-script ]; then
  32.             db_input high dhcp3-client/dhclient-script_moved || true
  33.             db_go
  34.         else
  35.             db_input high dhcp3-client/dhclient-needs-restarting || true
  36.             db_go
  37.         fi
  38.     fi
  39.  
  40.     if [ -e /etc/dhcp3/dhclient.conf.oldconfig ]; then
  41.         mv /etc/dhcp3/dhclient.conf.oldconfig /etc/dhcp3/dhclient.conf
  42.     fi
  43.  
  44.     # Reload AppArmor profile
  45.     profile="/etc/apparmor.d/sbin.dhclient3"
  46.     if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then
  47.         apparmor_parser -r "$profile" || true
  48.     fi
  49.  
  50.         if dpkg --compare-versions "$2" lt-nl 3.1.2-1ubuntu7; then
  51.             rm_conffile /etc/network/if-pre-up.d/dhclient3-apparmor
  52.         fi
  53.         ;;
  54.  
  55.     abort-upgrade|abort-remove|abort-deconfigure)
  56.         exit 0
  57.         ;;
  58.     
  59.     *)
  60.         echo "postinst called with unknown argument \`$1'" >&2
  61.         exit 0
  62.         ;;
  63. esac
  64.  
  65.  
  66.